<template>
  <div class="margin-box">
    <div class="title">{{button.title}}</div>
<!--    //图片部分-->
    <div class="body" @click="changeComponents">
      <el-image style="width: 100px;height: 100px;" :src="button.imgSrc" fit="contain"></el-image>
    </div>
  </div>
</template>

<script>
export default {
  name: "GameSelectorButton",
  props:{
    button:{
      required: true
    }
  },
  methods:{
    //返回选择的游戏id
    changeComponents(){
      this.$emit('selectGame',this.button.id)
    }
  },
}
</script>

<style scoped>
.margin-box{
  display: inline-block;
  background: #d79303;
  padding: 10px;
  margin: 5px;
  border-radius: 5px;
  border: 2px solid;
}
img{
  width: 280px;
  height: 280px;
}
.title{
  text-align: center;
  margin-bottom: 5px;
  border-bottom: 1px solid;
}
.body{
  text-align: center;
  cursor: pointer;
}
</style>
